<div class="modal-header">
    <div ng-include="'tpl/modal/workflow/include/header_info.html'"></div>
</div>


<div class="modal-body">

    <form class="form-horizontal" ng-show="workflowTodo.todoStatus == 0 && workflowTodo.todoPhase == 0"
          style="box-shadow: 0 0 5px #ddd;padding: 10px;">
        <div ng-include="'tpl/modal/workflow/include/help_info.html'"></div>
    </form>


    <form class="form-horizontal" style="padding: 10px;">
        <div class="form-group" ng-show="type == 0">
            <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>服务器组</label>
            <div class="col-lg-5">
                <ui-select ng-model="nowServerGroup.selected" theme="bootstrap">
                    <ui-select-match placeholder="搜索服务器组名称......">{{$select.selected.name}}</ui-select-match>
                    <ui-select-choices refresh="queryServerGroup($select.search)" refresh-dalay="0"
                                       repeat="item in serverGroupList | filter: $select.search">
                        <div ng-bind-html="item.name | highlight: $select.search"></div>
                    </ui-select-choices>
                </ui-select>
            </div>
            <div class="col-lg-3" ng-show="false">
                <label style="margin-top:5px;">
                    <input type="checkbox" ng-model="item.choose"><b style="margin-left:10px;">需要持续集成权限</b>
                </label>
            </div>
            <div class="col-lg-2">
                <button ng-click="addItem(item.choose)" class="btn btn-xs"
                        style="margin-top: 5px; background-color: limegreen; color: white;"
                        uib-popover-html="'添加'" popover-trigger="'mouseenter'">
                    <span class="glyphicon glyphicon-plus"></span>添加
                </button>
            </div>
        </div>

        <div class="form-group"  style="box-shadow: 0 0 5px #ddd;padding: 10px;">
            <table class="table table-hover table-bordered table-striped">
                <thead>
                <tr>
                    <td>服务器组</td>
                    <td>说明</td>
                    <td class="col-md-2" ng-show="workflowTodo.todoStatus == 0 && workflowTodo.todoPhase == 0 && type ==0">操作</td>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="todoDetail in workflowTodo.todoDetails">
                    <td>
                        <b style="color: #286090">{{todoDetail.detail.serverGroupDO.name}}</b>
                    </td>
                    <td>
                        <b style="color: #777">{{todoDetail.detail.serverGroupDO.content}}</b>
                        <!--<b style="color: #449d44" ng-if="todoDetail.detail.ciAuth == false">不申请</b>-->
                        <!--<span style="color: #777" ng-if="todoDetail.detail.ciAuth == true">-->
                        <!--<b ng-show="todoDetail.detail.ciUserGroupDO.id != 0" style="color: #286090">已申请:{{todoDetail.detail.ciUserGroupDO.groupName}}</b>-->
                        <!--<b ng-show="todoDetail.detail.ciUserGroupDO.id == 0" style="color: red">申请无效:组未配置</b>-->
                    </span>
                    </td>
                    <td ng-show="workflowTodo.todoStatus == 0 && workflowTodo.todoPhase == 0 && type == 0">
                        <button ng-click="delItem(todoDetail.id)" class="btn btn-xs pull-right"
                                style="background-color: #d9534f; color: white;"
                                uib-popover-html="'移除'" popover-trigger="'mouseenter'">
                            <span class="glyphicon glyphicon-remove"></span>移除
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>


        <div class="form-group">
            <label class="col-lg-2 control-label">申请说明</label>
            <div class="col-lg-10">
                            <textarea class="form-control" cols="3" placeholder="简短描述（小于100字）"
                                      ng-model="workflowTodo.content"></textarea>
            </div>
        </div>
    </form>

    <div style="width: 100%; height: 1px; border: 0.5px solid #eee;"></div>

    <form class="form-horizontal" style="margin-top: 25px;">
        <div ng-include="'tpl/modal/workflow/include/approval_info.html'"></div>
    </form>
</div>

<div class="modal-footer">
    <div ng-include="'tpl/modal/workflow/include/footer_info.html'"></div>
</div>
